home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Speccy ClassiX 1998
/
Speccy ClassiX 98.iso
/
amiga_system
/
the_aminet
/
comm
/
bbs
/
maxsbbsus.lha
/
MAX154
/
TBM
/
Txt
/
Fakekey.txt
< prev
next >
Wrap
Text File
|
1995-09-29
|
13KB
|
315 lines
I've just got to tell you about my two new buddies, FakeKey and
MovePointer. These guys are hysterical! Not to mention real life-savers.
FakeKey simulates a keyboard input. If you're editing a text file, and run
FakeKey, the little letters will pop onto the screen like you're typing them.
The important thing is that you can combine ANY key combination, including
the left-Alt/left-Amiga, or right-Alt/right-Amiga. Those, of course, are
your two mouse buttons. Okay, so much for the keyboard and mouse buttons,
now for the pointer.
MovePointer is a simple program that moves the pointer to a specified x-y
position. Nothin' fancy there. Yet.
What we can do is move the pointer to wherever we want, such as up to a
title bar, hold down the right mouse button with FakeKey, pull the pointer
down the drop-down menu, then release the right mouse button, opening a
requester. The pointer could then move to a specific location in the
requester, FakeKey could clear the box and input new information or click on
a file, then Save the information and close the requester.
Congratulations, Mr. Computer Operator, you've just been replaced.
What's `hysterical' about it is that it's like watching a ghost operate
your computer, really neat. But functionwise, with my new BBS software, the
two of them have already solved a few nagging problems, and I wouldn't have a
CD Of The Month without them.
I'll give a few examples in sec, but for those of you who were just
curious, let me sum up by saying, `just keep them in mind'. There may come a
time when you need the computer to perform a function while you're not there,
a function that...in the old days...only you could do.
FakeKey is 2.x-only, so if you're running under 1.3, there's most likely
a similar program out there that'll work.
*
First, something to note about FakeKey: When you enter a FakeKey command,
it STAYS that way until further notice. So whenever you make a "left mouse
click" with the commands "lalt lcommand", you then need to FakeKey some
innocuous command to release it. I use the Help key unless I'm editing a
text file, in which case a shift or backspace or something else will do.
*
Example 1 - Changing the info in a requester box:
What you basically do with your scriptfile is step-by-step make the exact
same moves (pointer, mouse and keyboard) that you would normally make to
change whatever it is you're changing.
MP brings the pointer up to the title bar.
FK holds the RMB down, the drop-down menu shows the selections.
MP pulls the pointer down to the operation you want.
FK releases the RMB, the requester pops open.
Wait 2 while the requester opens.
If you just need to click on an OK box or something, use MP to get you
there, then FK to simulate the LMB.
If you need to enter data, unless the cursor's already in the correct box,
use MP to get you there, then FK to hit the LMB to activate the box.
FK clears the box with right-Amiga-x.
FK inputs the new data.
Then you either have FK hit Return to close the requester or have MP go to
the OK box and FK closes it. Ta-da!
Two quick notes:
> First copy FK to ram, then make all the "FK"s in the scriptfile use the
Ram comand, just to save on disk wear.
> Make sure you Wait when necessary in the scriptfile, like when opening
and closing requesters or windows. I usually put in too many Wait
commands then pare things down later.
Example 2 - FakeKey Saves The CD Of The Month's Butt
I needed to get some way that the members could issue a written request,
so I checked out a few Questionaire doors, and settled on this "Program
Request" door, which lets the users request files in a separate area, rather
than the message base. So far, so good, only hassle is that all the
questionaire-type programs leave more on the line than just the request.
The ProgReq program saves the request as a binary file (has ANSI in it),
so the first thing that has to be done is to run Edible on it, to debinaryize
it. Then FakeKey really struts its stuff. The member enters his request,
hits the key, and in the background:
The scriptfile first runs Edible on the request, to remove the binary.
It then runs Ed to edit the new file.
There's some "[32m" garbage left over from the stripped binary, so the
first thing FK does is esc-d-return a few times to delete the first
couple of lines.
The line with the actual request in it looks something like this:
[35m[10CSysOp requested : honeyb.gif
FK enters esc-f-'-:-return, to search for the ":" in front of the file.
The cursor jumps out to the ":".
FK moves the cursor two spaces over to the right, over the "h" in "honeyb".
FK moves the cursor to the left a bunch of times, to erase everything to
the left of the file name all the way to the left margin. The only thing
on the line now is the requested file name.
FK inserts "Copy CD0:GIFS/#?/" in front of the file name.
FK enters right-shift/right-arrow to bring the cursor to the end of the
file name.
FK moves one space, then enters "Pics:temp", the destination directory.
FK enters esc-x-return to save the file.
The scriptfile then Executes the saved file, which will:
Copy CD0:GIFS/#?/honeyb.gif Pics:temp
The wildcards are so it can search through all the disk's subdirectories,
Pics:temp is where the file is stored. The member then hits the "Freshen up
download directory" function, which executes a scriptfile that Lists out the
contents of the Pics:temp directory, which the member can then read,
verifying that the file was found. He then downloads it, confused by all the
rigamarole he had to go through, but grateful he's getting his file. :)
But hey, it was either that, or log on 7,000 GIF pictures for just one
month. Thanks, but no thanks.
Example 3 - Endless Returns
For some odd reason, there's no Continuous Read on my BBS, so if you want
to list pages and pages of files, you have to keep hitting the Return over
and over again. Ah-ha! I whip up a scriptfile called Ram:xx that says:
FK 0 return
Wait 2
Execute Ram:xx
I then go to the BBS, flip on the Capture Buffer, list the first page of
files, go back to the Workbench, Execute the file Ram:xx, then flip back to
the BBS. FakeKey hits the Return for me, waits two seconds for the files
to display, then Executes itself all over again. When I get done, I flip
back to the Workbench and enter Ctrl-D to interrupt the scriptfile. Yes, I
then remember to flip back to the BBS to turn off the Capture Buffer. :)
Example 4 - Manipulating windows
I had this animation of my love, Amy The Squirrel, in FLC format, which is
some Mac thing. It was just a simple black & white drawing of her walking
along, about 20 frames, but naturally she looked terrific, and I knew it
would make a great addition to the collection.
The big problem, of course, was converting this .FLC animation to IFF.
Hunted all over the place, never found a converter, and neither ImageFX nor
ADPro's animation sequencers would handle it. But, thankfully, at least
ADPro recognized it as a format. I could load it up as an anim, and the
first frame would load. I could then convert it to 4-color IFF like normal,
and save the frame. Much to my surprise, when I re-loaded the anim, this
time it was on frame 2, which I could then convert and save. And then frame
3, then frame 4. Ah-ha!
My FakeKey/MovePointer scriptfile basically did just what I did above,
with a few keyboard command shortcuts used instead of MovePointer. It
loaded and re-loaded all 20 frames, rendering and saving each frame in the
process. I then simply combinded the frames with MakeAnim and had a
completely unique file for the board.
The main way it varied from doing it by hand was the naming of each saved
frame. I just had the scriptfile enter a "1" each time, so the file names
ended up being "1", "11", "111", "1111", etc, so having to rename them all
was a tad tedius, but the only work I, myself, had to do. When I come across
a 200-frame .FLC animation I just have to have, I'll work on it.
Example 5 - converting board file descriptions to file_id.dizs
This was pretty clever, using both SmartDOS (see other file) and FakeKey
together. I first made a capture buffer of, let's say, the sound effects.
Whole bunch of them, over 100. I edit the capture buffer and strip out the
file names & sizes, leaving just the descriptions. Got it pictured? Just a
long list of file descriptions. I close the Ed window down to its smallest
size and position it down at the bottom of the screen. This way MovePointer
will know where it is.
I then use SmartDOS to make a list of all the sound effect archives (the
directory I've Assigned XXX: to) and run the same scriptfile on each one of
them. The SmartDOS "Echo" string is:
Execute ed.scp
Wait 1
LZX u XXX:<name> Ram:file_id.diz
The "Execute ed.scp" script moves the pointer to the open Ed window, clicks
on it to activate it, then blocks off the first file description and writes
it to the file "Ram:file_id.diz". It then deletes the line, ready for the
next one. The SmartDOS file continues, using LZX to U)pdate the file with
the new file_id.diz file. It then repeats the same operation to the next
file, etc. Worked perfectly, only thing I had to pay attention to was making
sure the file descriptions lined up correctly with the actual files.
Example 6 - loading up requesters
This is a real lifesaver. I've got this new BBS software and it uses the
asl.library for loading files onto the board. Only one little hitch: I'm
loading up 100 files at a time, and the requester doesn't have any kind of
"batch load" feature. What it really needs is an ALL box to highlight all
the files, but I'd settle for a shift-scroll routine. Unfortunately, you
have to hold the shift bar down by hand and laboriously click each file.
Used to, that is.
The FakeKey/MovePointer file, itself, is pretty simple. Before you start,
you first open the requester and load up the dir. You then start the
scriptfile, which first goes to the top of the slide gadget box and clicks
once, to make sure everybody is alphabetized. It then goes to the first
selection, clicks, moves down (holding the shift key down all the while),
clicks on the next file, etc. When it gets to the bottom, assuming it's
going to continue, it zips over to the bottom of the slide gadget box and
clicks once, to advance to the next page.
I have a "20" scriptfile which goes down two pages, a "30" for three pages,
etcetera up to "100". What makes this particular routine fun is that I use
Switcher to start up the scripts with. Switcher is a screen controller that
opens up a small box when you click on both mouse buttons. You can go to any
screen listed, as well as execute external commands and scriptfiles. So, I
don't even have to go over to the Workbench to start the scriptfile, I just
load up the requester, hit the mouse buttons, choose the approriate script-
file and off we go.
Example 7 - Breaking up a big list into smaller ones
Problem: You have a list of 860 graphic archives, with descriptions. The
list is composed of JPEG, GIF, AGA and IFF pics, animations, DCTV files, a
couple of odd things like "X-Specs", etc, and you want to split them all into
different lists. Quite the imposing little task to do manually.
FakeKey saves your little butt AGAIN!!
> You pop up the list in a text editor, preferably a smart one like CygnusEd.
You want an editor that has a Search box that opens up, where you insert
the word you're looking for, so it'll still be there for the next search.
You could use a placcid text editor like Ed, and have FakeKey enter in a
"esc-f-"-g-i-f-Return" to find the GIF file, and "esc-d-Return" to delete
the line, but it'd take a lot longer.
> You search for the word "gif". The editor zips down to the first GIF pic.
> You kill the line.
> Let's say the Search feature is R-Amiga-s, and the K)ill is R-Amiga-k. You
write up a scriptfile that says:
FK 0 s ; searches for next "gif"
Wait 0 ; small rest stop*
FK 0 k ; kills line
Wait 0 ; small rest stop
FK 0 s
Wait 0
FK 0 k
Wait 0
FK 0 s
Wait 0
FK 0 k
Wait 0
<etc about fifty times>
* FakeKey and MovePointer are both pretty tiny, so when run out of Ram, you
need to leave a bit of time for the actual physical manipulation of the text.
That goes through the file and kills every GIF pic. You save the file as
"nogifs".
> The program "Diff" tells you the difference between two textfiles. You
Diff >gif.list -c original.file nogifs
That compares the two files and spits out the difference to a file called
"gif.list". That's your list of GIF pics. Clever, huh? And discounting the
two "Wait 0" lines in the scriptfile, all it took was two FakeKey commands
and a quick run through Diff. Piece o' cake.
> Repeat above procedure for "jpg" and "jpeg", to catch all the JPEG pics,
ditto everything else. By the time you strip out all the pics, all that
remains are, in theory, the tools.
Hope you enjoy FakeKey and MovePointer!
%Z